package cn.zdm.demo2.auth.controller;

import cn.zdm.demo2.auth.mapper.LogDescPoMapper;
import cn.zdm.demo2.auth.model.po.LogDescPO;
import cn.zdm.demo2.common.result.ResultObject;
import cn.zdm.demo2.common.result.ResultResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * copyright (C), 2021, 武大吉奥科技有限公司
 *
 * @Program demo2
 * @Description 日志服务
 * @Author ZhaoDeman
 * @Create 2021/1/20 10:39
 * @Version 1.0.0
 * <author>                <time>                  <version>                   <description>
 * ZhaoDeman        2021/1/20 10:39                 1.0                        日志服务
 */
@RestController
@Api(tags = "日志记录")
@Slf4j
public class LogController {

    @Autowired
    private LogDescPoMapper logDescPoMapper;

    @ApiOperation("查询所有的日志记录")
    @GetMapping("/log/queryAll")
    public ResultObject<Object> queryAllLog() {
        List<LogDescPO> result = logDescPoMapper.queryAllLog();
        return ResultResponse.success("查询日志成功", result.size(), result);
    }

}
